﻿@model IEnumerable<DAMS.Models.Category>
@{
    ViewData["Title"] = "List";
}

<h1>List</h1>

<p class="btn-group">
    <a asp-action="Create" class="btn btn-secondary">添加</a>
    <button type="button" class="btn btn-secondary">Middle</button>
</p>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.ID)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ParentID)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.LeftNum)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.RightNum)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Layer)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Type)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ShowType)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Content)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.DeleteFlag)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CreateTime)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.ID)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ParentID)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.LeftNum)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.RightNum)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Layer)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Type)
        
                    

                </td>
                <td>
                    <select  asp-items="@Html.GetEnumSelectList<DAMS.Models.CategoryShowType>(item.ShowType)" ></select>
                    @Html.DisplayFor(modelItem => item.ShowType)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Content)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.DeleteFlag)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CreateTime)
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
                    @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
                    @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
                </td>
            </tr>
        }
    </tbody>
</table>
